home *** CD-ROM | disk | FTP | other *** search
File List | 1991-08-21 | 6.2 KB | 109 lines | [TEXT/MPS ] |
-
- MC680xx Assembler - Ver 3.2b6 30-May-91 Page 1
- Copyright Apple Computer, Inc. 1984-1991
-
- Loc F Object Code Addr M Source Statement
-
- ;
- ;
- ; Copyright © 1991, Apple Computer, Inc.
- ;
- ; by Rob Glanville
- ;
- ; 15 May 91
- ;
- ; JG_prolog.a - Startup assembly code
- ;
- ;
- ; Memory Map - 512kb assumed
- ; 00000000 - 000003FF = Interrupt Vectors
- ; 00000400 - 000005FF = Command buffer
- ; 00000600 - 00007FFF = Stack
- ; 00008000 - 0000FFFF = Data
- ; 00010000 - 00017FFF = Code
- ; 00018000 - 0007FFFF = Free memory
- ; 00080000 - 00FFFFFF = Memory mapped I/O
- ;
- ; Since this code is linked in with the application that uses it, the
- ; A5 data reference changes every time variables are added or subtracted.
- ; To pin down the data for this code, A5 is adjusted so the top of the
- ; data is always at 10000. It's tricky so don't fool with it!
- ; The main purpose of this code is to provide a stable environment for
- ; the C code to start with. All the real work should be done in C.
- ; Try not to modify this code if possible, it is just a bridge.
- ;
- ; How this works;
- ; 1) The stack and data reference registers are initialized
- ; 2) The data segment is cleared
- ; 3) A key word is used to signal the Mac we're ready to go
- ; 4) We wait for a test command before jumping to the C code
-
- 0001 8000 TOS equ $18000 ; Top of stack
- 0000 FFFE TOD equ $fffe ; Top of Data
- 0000 03FE ClearCount equ $3FE ; Clear this many 32 bit words
- 0000 00FE VectorCount equ $fe ; Number of vector pointers
- 0000 0000 Null equ $00000000 ; Zero
- 0000 2700 InitialSR equ $2700 ; Initial status register
- 0000 0008 ClearStart equ $00000008 ; After the reset vector
- 0000 0000 Pattern equ $00000000 ; Clear memory pattern
- 0050 0000 GreenLight equ $00500000 ; Green light control
- 0040 0000 RedLight equ $00400000 ; Green light control
- 0060 0000 SmartMode equ $00600000 ; Smart mode control
-
- import COMMANDLOOP
-
- 00000 Begin proc export
- 00000 data
- 00000 import TopOfData ; First variable in C code
- 00000 code
- 00000 P 46FC 2700 move.w #InitialSR,sr ; Clear interrupts
- 00004 G 2E7C 0001 8000 move.l #TOS,sp ; Set up the stack pointer
- 0000A 1039 00CA 000C move.b $CA000C,d0 ; Reset and clear
- 00010 1039 00CA 0008 move.b $CA0008,d0 ; Reset and clear
- 00016 1039 00C0 0004 move.b $C00004,d0 ; Reset and clear
- 0001C 1039 00C0 0002 move.b $C00002,d0 ; Reset and clear
- 00022 G 4239 00CA 000D move.b #$00,$CA000D ; Reset and clear
- 00028 13FC 0087 00CA move.b #$87,$CA000F ; Reset and clear
- 000F
- 00030 G 4279 00CA 0008 move.w #$0000,$CA0008 ; Reset DMA control register
- 00036 3039 0060 0000 move.w SmartMode,d0 ; Select smart mode
- 0003C 3039 0040 0000 move.w RedLight,d0 ; Turn on red light
- 00042 33C0 0050 0000 move.w d0,GreenLight ; Turn off green light
- 00048 203C 0000 FFFE move.l #TOD,d0 ; Set up data pointer
- 0004E G 9BCD move.l #Null,a5 ; Set up data pointer
- 00050 41ED 0000 lea TopOfData,a0 ; Get address
- 00054 2208 move.l a0,d1 ; Copy
- 00056 9081 sub.l d1,d0 ; Adjust
- 00058 G 2A40 move.l d0,a5 ; Set the data offset
- 0005A 203C 0000 03FE move.l #ClearCount,d0 ; Set data size
- 00060 G 307C 0008 move.l #ClearStart,a0 ; Clear pointer
- 00064 G 4298 clear move.l #Pattern,(a0)+ ; Zap memory
-
- MC680xx Assembler - Ver 3.2b6 30-May-91 Page 2
- Copyright Apple Computer, Inc. 1984-1991
-
- Loc F Object Code Addr M Source Statement
-
- 00066 G 51C8 FFFC 00064 dbra d0,clear ; Loop back until done
- 0006A 43FA 0026 00092 lea UnusedInterrupt,a1 ; Get the pointer
- 0006E 203C 0000 00FE move.l #VectorCount,d0 ; Set vector count
- 00074 G 307C 0008 move.l #ClearStart,a0 ; Clear pointer
- 00078 20C9 Zap move.l a1,(a0)+ ; Zap memory
- 0007A G 51C8 FFFC 00078 dbra d0,Zap ; Loop back until done
- 0007E 3039 0050 0000 move.w GreenLight,d0 ; Turn on green light
- 00084 33C0 0040 0000 move.w d0,RedLight ; Turn off red light
- 0008A 6000 FF74 bra.w COMMANDLOOP ; Enter the C code
- 0008E 6000 FF70 00000 bra.w Begin ; Start over if we ever return
- 00092
- 00092 UnusedInterrupt
- 00092 21FC 496E 7430 move.l #'Int0',$0 ; Set the error flag
- 0000
- 0009A P 4E73 rte ; Interrupt return
- 0009C
- 0009C endp ; End of procedure
- end ; End of source
-
- Elapsed time: 0.15 seconds.
-
- Assembly complete - no errors found. 90 lines.
-